#include <logger\LogManager.h>

void database_operation() {
  auto db_logger = Logging::LogManager::get_logger("Database");
  db_logger->debug("Connecting to database...");
  db_logger->info("User 'admin' logged in successfully.");
}

void network_task() {
  auto net_logger = Logging::LogManager::get_logger("Network");
  net_logger->info("Fetching data from api.example.com.");
  net_logger->error("Failed to resolve hostname: api.example.com");
}

// int main() {
//   Logging::LogConfiguration config;
//   config.default_level =
//       Logging::LogLevel::kDebug;  // 设置级别为Debug以看到所有消息
//   Logging::LogManager::initialize(config);
//
//   database_operation();
//   network_task();
//
//   Logging::LogManager::shutdown();
//   return 0;
// }

/* 预期输出：
[HH:MM:SS.ms] [debug] [Database] Connecting to database...
[HH:MM:SS.ms] [info] [Database] User 'admin' logged in successfully.
[HH:MM:SS.ms] [info] [Network] Fetching data from api.example.com.
[HH:MM:SS.ms] [error] [Network] Failed to resolve hostname: api.example.com
*/